package com.code.common.models.po;

import com.code.common.enums.ResultCode;
import lombok.Data;

import java.io.Serializable;

/**
 * 请求返回结果结构类
 *
 * @param <T>
 */
@Data
public class ResultPO<T> implements Serializable {

    private ResultCode code;
    private T data;

    public ResultPO() {
        this.setCode(ResultCode.SUCCESS);
    }

    public ResultPO(ResultCode resultCode) {
        this.setCode(resultCode);
    }

    public ResultPO(ResultCode resultCode, T result) {
        this.setCode(resultCode);
        this.setData(result);
    }
}
